#!/usr/bin/python
#-*- coding: utf-8 -*-

###########################################################
# Copyright 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Kitchen of Awesome.
#
# Kitchen of Awesome is free software: you can redistribute it and/or 
# modify it under the terms of the GNU General Public License 
# as published by the Free Software Foundation, either 
# version 3 of the License, or (at your option) any later 
# version.
#
# Kitchen of Awesome is distributed in the hope that it will be 
# useful, but WITHOUT ANY WARRANTY; without even the implied 
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public 
# License along with Kitchen of Awesome. 
# If not, see http://www.gnu.org/licenses/.
###########################################################

from data import KoaObject

class User(KoaObject):
	MALE = 0
	FEMALE = 1
	@classmethod
	def createUser(cls, firstname, lastname):
		user = User()
		user.firstname = firstname
		user.lastname = lastname
		user.store()
		return user

	def __init__(self):
		KoaObject.__init__(self)
		self.id = None
		self.nick = None
		self.gender = None
		self.firstname = None
		self.lastname = None
		self.matricular = None
		self.birthday = None
		self.email = None

	def setFirstname(self, name):
		self.firstname = name

	def getFirstname(self):
		return self.firstname

	def setLastname(self, name):
		self.lastname = name

	def getLastname(self):
		return self.lastname
	

	def getDisplayName(self):
		genderstring = ("Hr.", "Fr.")
		return genderstring[self.gender]+" "+self.lastname+", "+self.firstname

KoaObject.registerClass(User)
	


